<template>
    <div>
        <h1>歌手详情——{{$route.params.name}}</h1>
        <img :src="singerDetail.cover" alt="" width="300">
        <p>{{singerDetail.briefDesc}}</p>
    </div>

</template>

<script>
    import axios from "axios";
    export default {
        name: "SingerDetail",
        data(){
            return {
                singerDetail:{},
                singerId:""
            }
        },
        props:["singer"],
        created(){
            this.singerId = this.$route.params.id
            console.log(this.singerId)
            axios.get(`https://koo-music.vercel.app/artist/detail?id=${this.singerId}`).then(res => {
                const {briefDesc,cover,...z} = res.data.data.artist
                this.singerDetail = {briefDesc,cover,...z}
                console.log(this.singerDetail)
            })
        }
    }

</script>

<style scoped>

</style>